package Test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class AutomaticRollCallDeviceTest1 {
    public static void main(String[] args) {
        //创建一个数组1表示男生，0表示女生
        //男生的概率百分之70，女生概率百分之30;
        ArrayList<Integer> arr = new ArrayList<>();
        Collections.addAll(arr,1,1,1,1,1,1,1,0,0,0);
        Collections.shuffle(arr);
        Random r = new Random();

       if(arr.get(0) == 1){
           ArrayList<String> list1 = new ArrayList<>();
           Collections.addAll(list1,"赵六","小y","小张","小李","小赵","小王","小高");
           int Index = r.nextInt(list1.size());
           System.out.println("被点到的是:" +list1.get(Index));
       } else if (arr.get(0) == 0) {
           ArrayList<String> list2 = new ArrayList<>();
           Collections.addAll(list2,"燕子","甜甜","花蕾");
           int Index = r.nextInt(list2.size());
           System.out.println("被点到的是:" +list2.get(Index));
       }else {
           System.out.println("错误");
       }


    }
}
